/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package entity;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;
import javax.enterprise.context.SessionScoped;
import javax.persistence.CascadeType;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.ManyToMany;
import javax.persistence.OneToMany;
import javax.persistence.Table;

/**
 *
 * @author Raphael
 */
@SessionScoped
@Entity
@Table(name="WIKI_GROUPS")
public class Groups implements Serializable{
    @Id @GeneratedValue(strategy = GenerationType.AUTO)
    private String groupid;
    
    @ManyToMany( mappedBy = "group",cascade = CascadeType.ALL)
    private List<User> user;

    public String getGroupid() {
        return groupid;
    }

    public void setGroupid(String groupid) {
        this.groupid = groupid;
    }

    public List<User> getUser() {
        return user;
    }
    public void addUser(User _user){
        if(user==null){
            this.user = new ArrayList();
        }
        this.user.add(_user);
    }
    public void setUser(List<User> user) {
        this.user = user;
    }


    
    
}
